﻿
@{
    ViewBag.Title = "sys5Edit";
    var F = Html.F();
}
@section body {
    @(
            F.Form()
            .IsViewPort(true)
            .BodyPadding(5)
            .ID("EditSys5Form")
            .ShowBorder(false)
            .ShowHeader(false)
            .Attribute("DataID", "System_5_10")
            .FieldReadOnlyAll(true, "str20")
            .RowsEx(1,
                    F.TextBox().ID("str20").Label("字典类型编号").Attribute("data", "System_5_20"),
                    F.TextBox().Label("中文名称").Attribute("data", "System_5_30"),
                    F.TextBox().Label("值").Attribute("data", "System_5_40"),
                    F.NumberBox().Label("顺序号").Attribute("data", "System_5_70")
                )
                .Toolbars(
                F.Toolbar().Items(
                    F.Button().Text("保存").IconFont(IconFont.Save)
                        .OnClientClick("save()"),
                    F.Button().Text("保存并新增").IconFont(IconFont.PlusCircle)
                        .OnClientClick("save(1)"),
                    F.Button().Text("保存并关闭").IconFont(IconFont.Close)
                        .OnClientClick("save(2)")
                    )
                )
    )
}
@section script {
    <script>
        F.ready(function () {
            F.ui.EditSys5Form.DataID = '@ViewBag.id';
            F.ui.EditSys5Form.setdata(@Html.Raw(ViewBag.data));
        })
        //保存
        function save(_type) {
            F.ui.EditSys5Form.savedata({ type: _type });
        }
        function savecallback(newid, type) {
            F.ui.EditSys5Form.DataID = newid;
            F.activeWindow.executeScript('lodeSys5Grid();');
            if (type == 2) {
                F.activeWindow.hide();
            }
            //保存并新增
            if (type == 1) {
                F.ui.EditSys5Form.reset();
                F.ui.EditSys5Form.DataID = 0;
            }
        }
    </script>

}
